import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../view/demoGDPbyLine/demoGDPbyLine'
import Pie from '../view/demoPeopleByPie/demoPeopleByPie'
import Bar from '../view/demoGDPbyBar/demoGDPbyBar'
// import Map from '../view/demoXaMap/demoXaMap'
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/',
    name: 'demoGDPbyXiAn',
    component: Index,
    meta:{
      // 页面标题title
      title: '西安市GDP-2018-Line'
    }
  },
  {
    path: '/pie',
    name: 'demoPeopleByPie',
    component: Pie,
    meta:{
      // 页面标题title
      title: '西安市人口-2019'
    }
  },
  {
    path: '/bar',
    name: 'demoPeopleByPie',
    component: Bar,
    meta:{
      // 页面标题title
      title: '西安市GDP-2018-Bar'
    }
  }
]
const router = new VueRouter({
  routes
})

export default router
